﻿///***************************************************************
/// 시  스  템 : Updms.Common.Inc
/// 단위시스템 : INC
/// 계      층 : Presentation Layer
/// 프로그램명 : NaverMapMultiMarker
/// 파  일  명 : NaverMapMultiMarker.aspx.cs
/// 설      명 : 네이버 맵 (멀티마커용 화면)
///***************************************************************
/// 수정ID 일자       이름     내용
///---------------------------------------------------------------
/// CH001  2011-08-27 송시명   최초 작성
///***************************************************************
using System;

using SMFramework.Data;
using SMFramework.Utility;

using Updms.Car.Exe;
using Updms.Crd.Exe;
using Updms.Etc.Exe;
using Updms.Ref.Exe;

namespace Updms.Common.Inc
{
	public partial class NaverMapMultiMarker : System.Web.UI.Page
	{
		protected static string mode = "CRD"; //CRD : 카드사용내역조회용 , ETC : 인원정보조회용
		protected static string markers = "";	//스크립트 리턴용
		protected static string param = "";	//추가파라미터

		#region Page_Load

		protected void Page_Load(object sender, EventArgs e)
		{
			if (Request.QueryString["mode"] != null)
			{
				mode = Request.QueryString["mode"].ToString();
			}

			if (Request.QueryString["param"] != null)
			{
				param = Request.QueryString["param"].ToString();
			}

			switch (mode.ToUpper())
			{
				case "CAR":
					GetStationLocation();
					break;
				case "CRD":
					GetCardUsedLocationMarkers();
					break;
				case "ETC":
					GetPersonLocation();
					break;
				case "REF_SHOP":
					GetShopLocationByShop();
					break;
				case "REF_TOUR":
					GetShopLocationByTour();
					break;
				default:
				break;
			}
		}
		#endregion

		#region 위치정보
		//차량관련업소의 위치정보
		private void GetStationLocation()
		{
			DataPack lo_dp = new DataPack();
			Car1013m_NT _Car1013m_NT = new Car1013m_NT();

			lo_dp.AddProperty("ls_use_yn", typeof(string), param);
			markers = DataSetUtil.GetStringFromDataSet(_Car1013m_NT.GetStationLocation(lo_dp), "UPDMS_CAR_STATION", "Markers");
		}

		//카드사용장소
		private void GetCardUsedLocationMarkers()
		{
			DataPack lo_dp = new DataPack();
			Crd1010m_NT _Crd1010m_NT = new Crd1010m_NT();

			lo_dp.AddProperty("ls_card_cd", typeof(string), param);
			markers = DataSetUtil.GetStringFromDataSet(_Crd1010m_NT.GetCardUsedLocationMarkers(lo_dp), "UPDMS_CRD_INFO", "Markers");
		}

		//지인의 위치정보
		private void GetPersonLocation()
		{
			DataPack lo_dp = new DataPack();
			Etc1010m_NT _Etc1010m_NT = new Etc1010m_NT();

			lo_dp.AddProperty("ls_use_yn", typeof(string), param);
			markers = DataSetUtil.GetStringFromDataSet(_Etc1010m_NT.GetPersonLocation(lo_dp), "UPDMS_ETC_PERSON_MGT", "Markers");
		}

		//업소의 위치정보
		private void GetShopLocationByShop()
		{
			DataPack lo_dp = new DataPack();
			Ref1010m_NT _Ref1010m_NT = new Ref1010m_NT();

			lo_dp.AddProperty("ls_shop_id", typeof(string), ""); //전체
			lo_dp.AddProperty("ls_favorite_yn", typeof(string), param);
			markers = DataTableUtil.GetStringFromDataTable(_Ref1010m_NT.GetShopLocation(lo_dp).Tables[0], "Markers");
		}

		//기행기의 위치정보
		private void GetShopLocationByTour()
		{
			DataPack lo_dp = new DataPack();
			Ref1010m_NT _Ref1010m_NT = new Ref1010m_NT();

			lo_dp.AddProperty("ls_shop_id", typeof(string), ""); //전체
			lo_dp.AddProperty("ls_favorite_yn", typeof(string), param);
			markers = DataTableUtil.GetStringFromDataTable(_Ref1010m_NT.GetShopLocation(lo_dp).Tables[1], "Markers");
		}

		#endregion

		public String MARKERS()
		{
			return markers;
		}
	}
}
